package cn.kduck.code.entity.service;

import java.util.List;

public interface EntityService {

    String CODE_ENTITY = "C_ENTITY";
    String CODE_ENTITY_FIELD = "C_ENTITY_FIELD";

    String addEntity(Entity entity);
    String addEntityField(EntityField field);

    void updateEntity(Entity entity);
    void updateEntityField(EntityField field);

    void deleteEntity(String[] entityIds);
    void deleteEntityField(String entityId,String[] fieldIds);

    Entity getEntity(String entityId);
    Entity getEntityByCode(String entityCode);
    Entity getEntityByFieldId(String fieldId);
    EntityField getEntityField(String fieldId);
    EntityField getEntityField(String entityId,String fieldCode);
    EntityField getEntityFieldByCode(String entityCode, String fieldCode);

    List<EntityField> listEntityField(String entityId);
    List<EntityField> listEntityField(String entityId,String fieldNameOrCode);

    void sortEntityField(String[] sortedIds);

    EntityField getPkField(String entityId);

    List<Entity> listEntity();

}
